package com.jorado.metrics.util;

public class StoreHelp {

    /**
     * Number of B in a KB.
     */
    public static final double BYTE_PER_KB = 1024;


    /**
     * Number of B in a MB.
     */
    public static final double BYTE_PER_MB = 1024 * 1024;

    /**
     * 秒为单位的监控区间示例
     */
    public static final double[] histogram_size_kb = new double[]{0.1, 0.5, 1, 5, 10, 20, 50, 80, 100};

    /**
     * B转KB
     *
     * @param sizeByB
     * @return
     */
    public static double toKB(double sizeByB) {
        return sizeByB / BYTE_PER_KB;
    }

    /**
     * B转MB
     *
     * @param sizeByB
     * @return
     */
    public static double toMB(double sizeByB) {
        return sizeByB / BYTE_PER_MB;
    }

}
